/**
 * @file
 * @auth jinguangguo
 * @date 2016/12/29
 */

import Vue from 'vue';
import tpl from './tpl.html';

import CONFIG from '../config';
import OrderMixin from '../orderMixin';
import PayDialog from '../component/confirmpayDialog.vue';

export default Vue.extend({
    name: 'myBuyOrder',
    template: tpl,
    mixins: [OrderMixin],
    data(){
        return {
            CONFIG: CONFIG,

            orderType: CONFIG.TYPE_BUY.KEY, // 當前訂單是買單還是買單
            status: CONFIG.TRADE_STATUS_UNPAY.KEY, // 當前訂單的狀態 未支付 已支付 已完成 申訴中
        }
    },
    watch: {
        'status'(val, oldval){
            this.fetchOrderList();
        },
        '$route.path'(newVal, oldval){
            if (newVal === '/order/buy') {
                this.fetchOrderList();
            }
        }
    },
    components: {
        PayDialog
    },
    methods: {

    }
});
